const path = require('path')

function resolve(dir) {
    return path.join(__dirname, dir)
}
module.exports = {
    //前三行打包静态
    // outputDir: '旅游',
    // assetsDir: 'static',
    runtimeCompiler: true,
    publicPath: './',
    lintOnSave: true,
    chainWebpack: (config) => {
        config.resolve.alias
            .set('@', resolve('src'))
            .set('views', resolve('src/views'))
            .set('components', resolve('src/components'))
            .set('assets', resolve('src/assets'))
    },
    devServer: {
        proxy: {
            '/api': {
                target: 'http://47.96.163.93:3000/api',
                changeOrigin: true,
                ws: true,
                pathRewrite: {
                    '^/api': ''
                }
            }
        }

        // plugins: {
        //     'autoprefixer': {
        //         browsers: ['Android >= 4.0', 'iOS >= 7']
        //     },
        //     'postcss-pxtorem': {
        //         rootValue: 37.5,
        //         propList: ['*', 'width']
        //     }
        // }
    }
}